]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
loginDialog: Get username directly from the conflicting session
authorAlessandro Bono <alessandro.bono369@gmail.com>
Mon, 19 Aug 2024 16:02:04 +0000 (18:02 +0200)
committerAlessandro Bono <alessandro.bono369@gmail.com>
Tue, 20 Aug 2024 10:38:41 +0000 (12:38 +0200)
The conflicting session is owned by the same user per definition.
Use the Name property of the conflicting session to get the
username instead of assuming that `this._user` is defined and
passing the username around.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3448>

data/dbus-interfaces/org.freedesktop.login1.Session.xml
js/gdm/loginDialog.js

index 5ebf2edf8795b8bd613777a0847be6970cb358e0..68c7d116228e30b6253a2b9444e784d8bd3018de 100644 (file)
@@ -5,6 +5,7 @@
     <property name="Active" type="b" access="read"/>
     <property name="Class" type="s" access="read"/>
     <property name="Id" type="s" access="read"/>
+    <property name="Name" type="s" access="read"/>
     <property name="Remote" type="b" access="read"/>
     <property name="State" type="s" access="read"/>
     <property name="Type" type="s" access="read"/>
index db83f4621c3243eff9bf252aa024b8d32f8daa21..9e1c050f806daf25a36c6c9459563ef1c4fccfc8 100644 (file)
@@ -414,9 +414,10 @@ export const ConflictingSessionDialog = GObject.registerClass({
         'force-stop': {},
     },
 }, class ConflictingSessionDialog extends ModalDialog.ModalDialog {
-    _init(conflictingSession, greeterSession, userName) {
+    _init(conflictingSession, greeterSession) {
         super._init();
 
+        const userName = conflictingSession.Name;
         let bannerText;
         if (greeterSession.Remote && conflictingSession.Remote)
             /* Translators: is running for <username> */
@@ -1091,8 +1092,7 @@ export const LoginDialog = GObject.registerClass({
 
     _showConflictingSessionDialog(serviceName, conflictingSession) {
         let conflictingSessionDialog = new ConflictingSessionDialog(conflictingSession,
-            this._greeterSessionProxy,
-            this._user.get_user_name());
+            this._greeterSessionProxy);
 
         conflictingSessionDialog.connect('cancel', () => {
             this._authPrompt.reset();